package multithreading.threadd.commonmethod;

public class Demo1 {
    public static void main(String[] args) {
     Thread A  = new MyDemo1("一号线程");
     //A.setName("一号线程");
        System.out.println(A.getName());//Thread-0

        A.start();
        Thread B= new MyDemo1("二号线程");
        B.start();
        System.out.println(B.getName());  //Thread-1
        //谁执行它他就得到谁的名字
        Thread C=Thread.currentThread();
        System.out.println(C.getName());

    }
}
